package bridge.main.switchs.sub;

import bridge.main.lights.ILight;
import bridge.main.switchs.BaseSwitch;

/**
 * 遥控开关，继承BaseSwitch扩展功能
 */
public class RemoteControlSwitch extends BaseSwitch {
    public RemoteControlSwitch(ILight light) {
        super(light);
    }

    /**
     * 使用遥控开关控制开灯
     */
    public final void makeRemoteLight(int openColor) {
        //打开开关，接通电流
        this.light.electricConnected();
        //照明
        this.light.light();
        String color;
        switch (openColor) {
            case 1:
                color = "暖色";
                break;
            case 2:
                color = "蓝色";
                break;
            case 3:
                color = "红色";
                break;
            case 4:
                color = "绿色";
                break;
            default:
                color = "白色";
                break;
        }
        System.out.println(String.format("水晶灯颜色:%s", color));
    }
}
